All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.Service
java.lang.Object
|
+----sun.server.Service
- public abstract class Service
- extends Object
- implements Runnable
An abstract class for implementing network services that manage multiple
connection handler threads.
-
avail
- The number of handler threads waiting for connections.
-
defaultServiceConfig
- Default service configuration.
-
handlers
- The thread group for handler threads.
-
maxThreads
- Maximum number of handler threads.
-
minThreads
- Minimum number of handler threads.
-
params
- The parameters for this service.
-
port
- The service port number.
-
serviceConfig
- Service configuration for this service.
-
serviceRoot
- Service root directory.
-
shutdown
- Set to true when service shutdown is in progress.
-
shutdownComplete
- Set to true when service shutdown is complete.
-
timeout
- Handler thread timeout.
-
total
- The total number of handler threads.
-
useNative
- Set to true if native library support is available.
-
Service()
- Creates a new service with default parameters.
-
Service(ServiceParameters)
-
-
createHandler()
- Creates a new connection handler.
-
error(String)
- Issues a non-fatal error message and returns.
-
error(String, Exception)
- Issues a non-fatal error message with exception trace and returns.
-
fatal(String)
- Issues a fatal (non-recoverable) error message and then exits.
-
fatal(String, Exception)
- Issues a fatal (non-recoverable) error message with exception trace
and then exits.
-
getAvailableHandlerThreads()
- Returns available handler threads for this service.
-
getConfiguration()
-
Get the configuration for the service.
-
getDefaultConfiguration()
-
Get the default configuration for the service.
-
getEndpoint()
- Returns the connection endpoint object, which is used to configure
transport level protocol features of this service.
-
getServiceParameters()
- Returns the parameters for this service.
-
getServiceRoot()
- Returns service root directory.
-
getTotalHandlerThreads()
- Returns total handler threads for this service.
-
init(ServiceConfiguration, ServiceConfiguration)
- Initializes the service with specified configuration.
-
inShutdown()
- Returns true if this service is in the process of a shutdown.
-
isShutdownComplete()
- Returns true if this service has completed its shutdown.
-
prepareForStartup()
- Prepare the service for starting.
-
run()
- Starts the service.
-
shutdown()
- Initiates service shutdown.
-
waitJeevesEvent()
- Blocks until the Jeeves Event is triggered.
serviceRoot
protected String serviceRoot
- Service root directory.
handlers
protected ThreadGroup handlers
- The thread group for handler threads.
minThreads
protected int minThreads
- Minimum number of handler threads.
maxThreads
protected int maxThreads
- Maximum number of handler threads.
timeout
protected long timeout
- Handler thread timeout.
port
public int port
- The service port number.
avail
protected int avail
- The number of handler threads waiting for connections.
total
protected int total
- The total number of handler threads.
shutdown
protected volatile boolean shutdown
- Set to true when service shutdown is in progress.
shutdownComplete
protected boolean shutdownComplete
- Set to true when service shutdown is complete.
params
protected ServiceParameters params
- The parameters for this service.
useNative
protected static boolean useNative
- Set to true if native library support is available.
serviceConfig
protected ServiceConfiguration serviceConfig
- Service configuration for this service.
defaultServiceConfig
protected ServiceConfiguration defaultServiceConfig
- Default service configuration.
Service
protected Service(ServiceParameters params)
Service
protected Service()
- Creates a new service with default parameters.
getEndpoint
public synchronized ConnectionEndpoint getEndpoint() throws ConfigurationException
- Returns the connection endpoint object, which is used to configure
transport level protocol features of this service. A given service
may operate over different transport level protocols, or using more
than one transport access point, as encapsulated through connection
endpoint objects.
At this time only one endpoint is supported per service; this
is in the "endpoint" group.
- Throws: ConfigurationException
- when the configuration parameters
have illegal values
init
protected abstract void init(ServiceConfiguration configuration,
ServiceConfiguration defaultConfiguration) throws ConfigurationException
- Initializes the service with specified configuration.
- Throws: ConfigurationException
- indicates that the service
was given illegal configuration information
prepareForStartup
protected void prepareForStartup()
- Prepare the service for starting. Called from ServerProcess
when the service is about to be restarted.
run
public void run()
- Starts the service. Will return when service has been stopped.
createHandler
protected abstract ServiceHandler createHandler()
- Creates a new connection handler.
- Returns:
- the handler object
getServiceParameters
public ServiceParameters getServiceParameters()
- Returns the parameters for this service.
getTotalHandlerThreads
public int getTotalHandlerThreads()
- Returns total handler threads for this service.
getAvailableHandlerThreads
public int getAvailableHandlerThreads()
- Returns available handler threads for this service.
shutdown
protected synchronized void shutdown()
- Initiates service shutdown.
inShutdown
public boolean inShutdown()
- Returns true if this service is in the process of a shutdown.
isShutdownComplete
public synchronized boolean isShutdownComplete()
- Returns true if this service has completed its shutdown.
error
protected void error(String s)
- Issues a non-fatal error message and returns.
- Parameters:
- s - the error message
error
protected void error(String s,
Exception e)
- Issues a non-fatal error message with exception trace and returns.
- Parameters:
- s - the error message
- e - the error exception
fatal
protected void fatal(String s)
- Issues a fatal (non-recoverable) error message and then exits.
- Parameters:
- s - the error message
fatal
protected void fatal(String s,
Exception e)
- Issues a fatal (non-recoverable) error message with exception trace
and then exits.
- Parameters:
- s - the error message
- e - the error exception
getConfiguration
protected ServiceConfiguration getConfiguration()
- Get the configuration for the service.
- Returns:
- the service's configuration.
getDefaultConfiguration
protected ServiceConfiguration getDefaultConfiguration()
- Get the default configuration for the service.
- Returns:
- the service's default configuration.
getServiceRoot
public String getServiceRoot()
- Returns service root directory.
- Returns:
- the service's root.
waitJeevesEvent
public native void waitJeevesEvent()
- Blocks until the Jeeves Event is triggered. The thread invoking this
method should invoke the shutdown() method on returning from this
method.
All Packages Class Hierarchy This Package Previous Next Index